﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using NUnit.Framework;
using DataAccessLayer;
using BusinessLogicLayer;

namespace SolutionTests
{
    [TestFixture]
    public class NUnitTestFixture
    {
        [Test]
        public void ConstructorWithParamsTest()
        {
            User u = new User(0, "Doe", "John", "logIn", "111111", 0, true);
            Console.WriteLine(u.ToString());
            User u1 = new User(1, "Doeee", "Johnnny", "logInnnn", "555555", 3, true);
            Console.WriteLine(u1.ToString());
        }

        [Test]
        public void IsPasswordValidTest()
        {
            string passCORRECT = "123456";
            string passWRONG = "123457";
            string passHash="gNA79QqajZgNwQfQvUJljUt7y5+b3NjY23A=";
            Console.WriteLine(passHash);
            Console.WriteLine("Password: " + passCORRECT + "\nIsValid - "+User.IsPasswordValid(passCORRECT,passHash).ToString());
            Console.WriteLine("Password: " + passWRONG + "\nIsValid - " + User.IsPasswordValid(passWRONG, passHash).ToString());
        }

        [Test]
        public void BusynessLogicTest()
        {
            TasksDashBoard tDashBoard = (TasksDashBoard)DashBoardManager.CreateDashBoard(LayerType.TasksDashBoard);

            foreach (WorkItem task in tDashBoard.Columns[Statuses.Done].ColumnItems)
            {

                Console.WriteLine(task.Name + "   " + task.Status);
            }
        }
    }
}

